import dayjs from "dayjs";
import customParseFormat from "dayjs/plugin/customParseFormat";
dayjs.extend(customParseFormat);
// 表单配置
export const formConfig: FormConfigItem[] = [
    {
      label: "姓名",
      name: "name",
      type: "input",
      rules: [{ required: true, message: "请输入姓名" }],
    },
    {
      label: "性别",
      name: "gender",
      type: "radio",
      options: [
        { label: "男", value: "male" },
        { label: "女", value: "female" },
      ],
    },
    {
      label: "职位",
      name: "position",
      type: "select",
      options: [
        { label: "开发", value: "developer" },
        { label: "设计", value: "designer" },
        { label: "产品", value: "product" },
      ],
    },
    {
      label: "上班时间",
      name: "workTime",
      type: "time",
    },
    {
      label: "生日",
      name: "birthday",
      type: "date",
    },
    {
      label: "日期",
      name: "date",
      type: "dateRange",
      format: "YYYY-MM-DD",
      defaultValue: [dayjs().subtract(7, "day"), dayjs()],
      disabledDate: (current) => {
        // 不可选择的日期逻辑
        return current && current < dayjs().subtract(1, "day");
      },
    },
  ];